home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 23.zip
/
BS1 part 23
/
Macro Paint v1.10.adf
/
Macro.ARexx
< prev
next >
Wrap
Text File
|
1991-02-21
|
19KB
|
527 lines
___________________________________________________________________
This file lists all of the ARexx commands supported in Version 1.00
___________________________________________________________________
*mp_asknumreq MIN MAX VALUE PROMPT
This command opens a numeric requester on
the Macro Paint ToolStrip and passes the result back to the ARexx program.
The MIN and MAX arguments are the minumum and maximum value the user may
enter respectively. PROMPT is an argument string containing the text to be placed
in the title bar of the requester window. To request a `repetition count'
between 1 and 20 the command would be: mp_asknumreq 1 20 "Enter the
repetition count:" New: VALUE is the initial value of the number.
*mp_askreq PROMPT
This command opens a simple `Yes/No'
requester on the Macro Paint ToolStrip and passes the result back to the
ARexx program. The PROMPT string appears in the requester window above the
`Yes/No' response gadgets. The result will be a single character
string, either `Y' or `N'. To ask the user if he/she wishes to continue,
issue the command: mp_askreq "Do you wish to continue?".
*mp_askstringreq PROMPT
This command opens a `string'
requester on the Macro Paint ToolStrip and passes the result back to the
calling ARexx program. The PROMPT string appears in the title bar of the
requester above the string gadget. Any string the user enters is passed
back as the result string. To prompt for the user's name, issue the
command: mp_askstringreq "What is your name?".
*mp_bcomp
This command is identical to the
`Brush/ Mask/ Complement' menu selection. It turns the current brush into a
complemented image that looks like a photographic negative.
*mp_bmono
This command is identical to the
`Brush/ Color/ Monochrome' menu option. It turns the current brush into a
monochrome (black and white) image.
*mp_bmask
MODE This command replaces three menu items:
`Brush/ Mask/ Cyan', `Brush/ Mask/ Magenta', and `Brush/ Mask/ Yellow'. The MODE
argument takes the value 0, 1, or 2 respectively. The command
mp_bmask 1 will mask the magenta component out of the brush.
*mp_bspin
This command rotates the current brush by
90\degrees.
*mp_btint
This command is equivalent to selecting the
`Brush/ Color/ Tint' menu option. It blends the current brush with the
current pen color using the current tint percentage.
*mp_bwash
RED GREEN BLUE This command similar to selecting the
`Brush/ Color/ Tint' menu option. It tints the current brush using the
current tint percentage. Unlike the mp_ctint command it uses a
color passed as a parameter as the tint color, not the current pen color. The color
component parameters are integers in the range 0-255. The 4 least
significant bits are ignored at this time. The command mp_bwash 0
255 0 will blend the brush with pure green.
*mp_bxflip
This command flips the current brush
horizontally.
*mp_byflip
This command flips the current brush
vertically.
*mp_cfill X Y R
This command draws a filled circle using
the arguments X and Y as the center point and the argument R as the radius
(in pixels). The circle will be drawn in the current pen color. The command
mp_cfill 100 100 30 will draw a solid circle centered at 100,100
with a radius of 30 pixels.
*mp_circle X Y R
This command draws a circle (outline)
using the arguments X and Y as the center point and the argument R as the
radius (in pixels). The circle will be drawn using the current pen color
and brush style. The command mp_circle 100 100 30 will draw a circle
centered at 100,100 with a radius of 30 pixels.
*mp_clear
This command clears the screen. It it
identical to selecting `Project/ Clear' from the menu. Please note that it
does not prompt the user with an `Are you Sure?' requester so {\it do
not use this command unless you really want to clear the screen!
*mp_clip X1 Y1 X2 Y2
This command is functionally equivalent
to the `Cut out a brush' tool. The two pairs of XY coordinates are used as the
upper left and lower right corners of the rectangular region to be cut out.
To cut out a 50 X 50 brush starting at 100X100, issue the command
mp_clip 100 100 150 150. You cannot cut out an irregular (lasso) brush
from ARexx.
*mp_compreg
This command is equivalent to the
`Image/ Mask/ Complement' menu option. It complements all the colors in the
current region to produce a `photo-negative' effect.
*mp_copy
This command copies the current page to the spare
page. It is equivalent to selecting `Spare/ Copy To' from the menu.
*mp_curve X1 Y1 X2 Y2 X3 Y3
This command is the ARexx
equivalent to the curve drawing tool. It draws a curve using X1,Y1 and
X2,Y2 as the endpoints, with X3,Y3 serving as a control point. The curve is
drawn using the current pen color and brush style. The command
mp_curve 100 100 300 300 150 175 draws a curve from 100,100 to 300,300
with the control point at 150,175.
*mp_delete
This command deletes the spare page. It
has no effect if there is no spare page allocated. It does not prompt the
user for confirmation so use it with care.
*mp_efill X1 Y1 X2 Y2
This command draws a filled ellipse
in the current pen color. The ellipse is centered at X1,Y1; the radii of
the ellipse are determined by the point X2,Y2. The command mp_efill
300 150 100 170 draws a tall solid ellipse centered at 300,150.
*mp_ellipse X1 Y1 X2 Y2
This command draws an ellipse
(outline) using the current pen color and brush style. The ellipse is
centered at X1,Y1; the radii are determined by the point X2,Y2. The
command mp_ellipse 300 150 100 170 draws a tall outlined ellipse
centered at 300,150.
*mp_exit
This option is equivalent to selecting the
`Project/ Quit' menu item and answering `Yes' to the confiming requester. Do
not issue this one unless you want to exit Macro Paint without saving your
work.
*mp_fill X Y
The ARexx equivalent to the flood fill
tool, this command does a flood fill in the current pen color starting at
X,Y. The command mp_fill 100 100 fills an area starting at the pixel
at 100,100 and fills until it hits another color or the edge of the screen.
*mp_getaddress LINE
This command returns a hexadecimal
string containing the address of a line in Macro Paint's internal bitmap.
This is useful if you wish to directly manipulate the 12-bit 4096 color
information that Macro Paint keeps for each pixel. Each horizontal
line has its own array of color information. One unsigned 16 bit word is
allocated for each pixel on the line, and the lower 12 bits are used to
store the RGB value of that pixel. The format of this UWORD is `4 0xXRGB' where
`X' is reserved for use by Macro Paint, `R' is a nibble containing
the red component of the color, and `G' and 'B' contain the green and blue
components. If you are changing the data in the bitmap you must set `X'
(the four most significant bits) to 0. If you are reading from the bitmap
you will need to mask off the upper nibble as it will rarely contain 0.
Finally, once you have modified the bitmap you must issue an
mp_remap command before the display will be updated. Pay special attention
to the `4' preceding the address! If the string returned is preceded by an
`8' then you are getting the address of an array of 32 bit {\it long
words with 8 bits per color component and the 8 most significant bits
reserved; this is for future expansion and is not currently supported.
mp_getbackground
This command returns the current
background color. The format of the result string is `R G B' where each
color component is an integer in the range 0-255. The 4 least significant bits
of each color component are not used.
mp_getbrush
This command returns the size and address of
the current brush. The format of the result string is `4 WIDTH HEIGHT
0xADDRESS'. The width and height are decimal integers. The address is a
hexadecimal number which is a pointer to the brush data. The brush data
consists of a WIDTH X HEIGHT array of unsigned 16 bit words; the least significant
12 bits of each word is the 4096 color RGB value of that pixel. The four
most significant bits are undefined. They should be set to 0 if a pixel is
changed. Pay special attention to the `4' preceding the address! If the
string returned is preceded by an `8' then you are getting the address of
an array of 32 bit {\it long words with 8 bits per color component and the 8 most
significant bits reserved; this is for future expansion and is not currently
supported.
mp_getcolor
This command returns the current pen color.
The format of the result string is `R G B' where each color component is
an integer in the range 0-255. The 4 least significant bits of each color
component are not used.
mp_getfile
PATH TITLE This command opens the file
requester with the string TITLE in the title bar and the directory
set to PATH. It returns the full file name and path of the file
selected by the user.
mp_getpalette
COLOR This command returns the R G B color
components of one of the colors in the palette. The result is returned in a
string RED GREEN BLUE where each color component is an integer in the
range 0 to 255. The COLOR parameter is in the range 0-11; there are
12 colors on the palette.
mp_getpixel X Y
This command returns the color value of the
pixel at the X,Y coordinate. The value is returned in a result string of
the format `RED GREEN BLUE' which contains three integers from 0-255
separated by spaces. Note that the least significant 4 bits of the color
components are not used; a full 24-bit value is returned for future
compatibility.
mp_getpoint
This command returns the X,Y coordinate
of a pixel selected by the user. The mouse pointer is changed to a crosshair with
the word `Point' under it until the user clicks the left mouse button, then
the result string is returned to the ARexx program. The result string takes
the format ` X Y', where X and Y are integer pixel coordinates.
mp_getline
This command returns the X,Y coordinates
of the two end points of a straight line chosen by the user. The mouse
pointer is changed to a crosshair with the word `Line' under it until the
user clicks the left mouse button, moves the mouse, and releases the
button. Macro Paint then returns the result string X1 Y1 X2 Y2 to the ARexx
program. The user sees a rubber-band line while selecting the two points.
mp_getregion
This command returns the X,Y
coordinates of the two opposite corners of a rectangle chosen by the user.
The mouse pointer is changed to a crosshair with the word `Area' under it
until the user clicks the left mouse button, moves the mouse, and releases
the button. Macro Paint then returns the result string X1 Y1 X2 Y2 to the
ARexx program. The user sees a rubber-band box while selecting the two
corner points.
mp_getsize
This command returns a string containing
the width and height of Macro Paint's screen. On a default system, it might
return the string `640 400'.
mp_line X1 Y1 X2 Y2
This command draws a line from X1,Y1
to X2,Y2 using the current pen color and brush style. For example, the
command mp_line 100 100 400 200 would draw a line from 100,100 to
400,200.
mp_loadbrush FILENAME
This command loads an IFF picture as
a brush. The FILENAME argument is a string containing the name of the file
along with any path or volume specifier required.
mp_loadpic FILENAME
This command loads an IFF picture into
Macro Paint. The argument FILENAME is a string containing the name of the
file along with any path or volume specifier required. For example, the
command mp_loadpic DF1:images/TimeMachine would load the file
`TimeMachine' from directory `images' on volume `DF1:'.
mp_loadspare FILENAME
This command loads an IFF picture into Macro Paint's SPARE PAGE. This
is extremely useful for stand-alone slide-show ARexx programs; we added
it for World of Amiga/Toronto. The argument FILENAME is a string containing
the name of the file along with any path or volume specifier required.
mp_loadreg FILENAME
This command loads and IFF picture into
the current image region. The image is clipped at the boundries of the
region.
mp_magnify [SIZE]
This command sets or changes the state of
the magnify window. If the SIZE parameter is 0, the magnify window is
closed. If SIZE is 1 the window is opened and set to 2X scale. If
SIZE is 2 the window is opened and set to 4X scale. If no parameter
is supplied it returns the current state of the magnify window as a string
containing `0', '1', or '2'.
mp_mapcolor PENCOLOR
This command sets the current pen color
to the PENCOLOR entry in the palette; there are 12 colors in the palette
which are numbered 0-11. For example, if the second color on the palette strip
is red, issuing the command mp_setcolor 1 will change the current pen color
to red.
mp_mapoff
This command instructs Macro Paint
to disable automatic color remapping after each command. When performing a
long ARexx script this can result in a tremendous speed improvement.
mp_mapon
This command re-enables Macro
Paint's automatic color mapping. It is important to issue an
mp_remap command after this in order to update the display.
mp_monoreg
This command changes the pixels current image
region into black \& white by removing all color and assigning a grey
scale intensity to each pixel.
mp_paste X Y MODE
This command pastes a brush that
has been previously cut out by the user. X and Y are the
coordinates to paste the brush to, and MODE is the type of paste
operation to perform. Currently supported paste operations are 0- Normal,
1- Blend, 2- Add, and 3- Subtract.
mp_plot X Y
This command draws a single pixel as if
the user was painting in dotted freehand mode. It uses the current pen
color and brush style.
mp_printfull
This commands starts a print
operation, using enough RAM to print a full screen bitmap in a single pass.
Macro Paint uses the current system preferences when printing.
mp_printprefs
This command runs the system printer
preferences program, giving the user the opportunity to change the options
before printing.
mp_printstrip
This command starts a print operation
using only a small amount of RAM. The image is printed in `strips' using
the current system preferences settings. Note that when using this command
is used the built in preferences scaling and rotation may not work properly
because the printer driver does not have access to the entire bitmap at once.
*mp_rectangle X1 Y1 X2 Y2
This command draws a
rectangle using the current pen color and brush style. The rectangle is
draw with (X1,Y1) anf (X2,Y2) at opposite corners.
*mp_region X1 Y1 X2 Y2
The command sets the postition
and size of the image region. (X1,Y1) is the upper left corner of the
region and (X2,Y2) is the lower right corner.
region.
mp_remap HEIGHT STARTY
This command is used to force
Macro Paint to remap part of the screen. The HEIGHT parameter
is the number of horizontal lines to remap, and the STARTY parameter
is the first line to remap. For example, to remap lines 100 to 300 of the
screen, you would issue the command mp_remap 200 100.
*mp_rfill X1 Y1 X2 Y2
This command draws a solid
rectangle filled with the current pen color. The rectangle is with
(X1,Y1) and (X2,Y2) as opposite corners.
mp_rtint
This command tints the current image
region using the current pen color and tint percentage value. It is
functionally identical to selecting the Image/ Color/ Tint option from the
menu.
mp_save24
FILENAME This command saves the current
picture in a 24-bit IFF file called FILENAME.
mp_savepic
FILENAME This command saves the current
picture as a dynamic hires IFF file called FILENAME.
mp_sayreq STRING
This command opens a requester with
the message STRING displayed for the user. The user must click on
`OK' to close the requester.
mp_scale [ON|OFF]
This command is used to set or check the
auto-scale option. If no parameter is supplied, the result string will be
either `ON' or `OFF' depending on the current state of the menu item. If
`ON' is supplied as a parameter, auto-scale will be turned on; an `OFF'
parameter turns it off.
mp_setcolor RED GREEN BLUE
This command sets the current pen
color. The color components are integers in the range 0-255. Thus, to set
the pen color to pure green you would issue the commnd mp_setcolor 0
255 0.
mp_setfont NAME SIZE
This command sets the current
font used by the text tool. To set the font to 11 point Topaz, you would
issue the command mp_setfont Topaz 11. Please note that color fonts
and Anim fonts are not fully supported.
mp_setpen PENSTYLE
This command sets the brush style
to one of the ten built in styles. The argument PENSTYLE is a single
digit from 0-9.
mp_setpixel X Y R G B
This command changes the color of
the individual pixel located at X,Y. The R, G, and B parameters are
integers in the range 0-255. The 4 least significant bits of each color
component are currently ignored; the full 24-bit value is passed for future
compatibility.
*mp_spray X Y NUM
This command gives you control over
the air brush tool. (X,Y) are the coordinates to spray at, and
NUM is the number of pixels to randomly paint in the area around
(X,Y). The higher the NUM, the higher the density of the spray.
*mp_spraysize AREA
This command sets the spray radius of
the air brush tool. The default is 8.
*mp_swap
This commands is functionally equivalent to
the `Spare/ Swap' menu option. It swaps the current page with the spare page.
*mp_text X Y STRING
This commands draws the text
STRING at the position (X,Y) using the current font, size, and pen
color.
*mp_tintval TINTVALUE
This command sets the tint
percentage value used by the tint and blend functions. Legal values for
TINTVALUE are in the range 0-100.
ARexx!Command Reference!Tint Percent
*mp_toggle
This command toggles the ToolStrip on and
off. It is functionally equivalent to pressing `F10'.
mp_toolstrip [ON|OFF}
This command returns the current state of the ToolStrip if no parameters
are supplied. If ON or OFF is supplied, the ToolStrip is switch to that
state. The result string is either `ON' or `OFF'.
mp_transparent [ON|OFF]
This command sets the transparency option. If no parameter is supplied
it returns either `ON' or `OFF', indicating the current state of the
checkmark. Sending the command mp_transparent ON turns transparency on,
and mp_transparent OFF turns it off.
*mp_version
This command returns the version number of Macro Paint. It is an integer.
Version 1.00 will return the string ~100".